<?php

class Chapter_m extends CI_Model{
    function __construct() {
        parent::__construct();
        $this->load->database();
    }
    
    function insert($arr){
        $this->db->insert('chapter',$arr);
    }
    
    function update($id,$arr){
        $this->db->where('id',$id);
        $this->db->update('chapter',$arr);
    }
    
    function delete($id){
        $this->db->where('id',$id);
        $this->db->delete('chapter');
    }
    
    function select($id){
        $this->db->where('id',$id);
        $this->db->select('*');
        $query=$this->db->get('chapter');
        return $query->result();
    }    
    
    function getlist($subjectid){
        $this->db->where('subjectId',$subjectid);
        $this->db->select('*');
        $query=$this->db->get('chapter');
        return $query->result();
    }
}

